Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This adds support for the
extendskeyword which lets the tests pass on Build 4075 as requested in #323. The implementation is very hacky right now:base_syntaxwhen parsing a syntax, if thebase_syntaxis not present and we find anextendskeyword at the top level, we error out reporting which syntax file we expected.SyntaxSetBuilderhandles this error and resolves the syntaxes in a loop until no more syntaxes can be resolved.extendsmight be a list).contextsas defined in the spec (you can override variables and have that affect the context).extendsfor syntaxes added throughSyntaxSetBuilder::load_from_folder.I am opening this PR on top of #535 to get the fixes to the tests.
I don't know if this is a correct implementation of the
extendskeyword, specifically, I don't know when contexts are evaluated; the contexts are properly merged, but the variables can be overwritten and thus the context needs to be re-evaluated, I don't know if I need to do something about it, or id the context evaluation is done after theSyntaxSetis built.I am not happy with the implementation either, but I don't know how to improve it further. I will happily improve it if you have any ideas.
Ideally,
SyntaxSetBuilder::buildwould return an error that indicates the syntax was unable to extend another syntax.